function  bci=bciTrainBayesLDA(bci,T)


LABELS = ones(size(T.label));
idx1=T.label == bci.eventsToClassify(1);
idx2=T.label == bci.eventsToClassify(2);
idx = find(T.label ~= bci.eventsToClassify(1) & T.label~=bci.eventsToClassify(2));

LABELS(idx1) = 1;
LABELS(idx2) = -1; % only first two classes
% discard all other events train samples 
LABELS(idx,:)=[];
T.dat(idx,:) = [];

bci.BayesLDA = bayeslda(0);
bci.BayesLDA = train(bci.BayesLDA,T.dat',LABELS');
